New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warnings cleanup #5964
Warnings cleanup #5964
Conversation
rpcs3/Emu/RSX/VK/VKHelpers.cpp
Outdated
@@ -517,6 +518,7 @@ namespace vk | |||
barrier.srcAccessMask = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_INPUT_ATTACHMENT_READ_BIT; | |||
src_stage = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT; | |||
break; | |||
default: break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default should throw "Attempted to transition from invalid layout"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making this change causes Vulkan to crash the emulator in all games, as discovered by our favorite Finn Jotain. Falling through allows normal behavior.
I've got a few commits elsewhere cleaning up the third party warnings, but I'm still working on trying to get the include dirs passed to clang cleaned up. That'll clean up another few hundred errors. If anyone with knowledge about some of the remaining rpcs3 warnings (@elad335 @Nekotekina maybe?) and think of a way to resolve them, I can put those changes here too. The problem is that those instructions are wrapped in macros that disable them for missing instruction sets. However the macros are just left blank, generating a warning. For example, after the preprocessor is run, we get code like the following which is just weird |
I've gone ahead and implemented the changes to silence 3rd party code. I put in some PoC workarounds for the macro issues; these changes may or may not be okay. Currently, the clang travis build produces no warnings of any kind. The log has gone from 8665 lines to 1220. I still have more plans. Neko recently turned on extra warnings (-Wall) for gcc that was not turned on for clang. I plan to unify the flags between the 2 compilers, since they are mostly compatible. I will try to get as close to exact -Wall compliance as I can in future commits. Perhaps even -Wextra if enough gets done. Hopefully we can maintain this into the future. |
The 3rdparty warning silence doesn't seem to work on MSVC (using CMake). Not only does it let errors through but it now also spams I can upload the whole compile output somewhere if you're interested in wading through it. |
Indeed, I did not add all the warning wrappers to msvc, just the one. msvc is at the bottom of my priority list right now, since I can barely read the output and my branch is on linux. |
I've pushed an update with quite a bit of changes to what's going on. When adding -Wall to the compilers, many more warnings were exposed. It was both too many for me to handle, and also well outside my knowledge to fix. So while refactoring the cmake setup to be (hopefully) more clear than it was before, I decided to simply enumerate all the warnings as silenced, rather than not use -Wall. This may seem odd (and that list is disturbingly long), but it provides a number of advantages. For one, the sight of it may encourage devs to begin working on them. For another, the log output is much cleaner, meaning that new PRs will have new warnings immediately highlighted for all to see, preventing issues from creeping in. It also provides a neat little way for contributors to help the issue, as this is larger than one dev can handle. Simply pop a warning off the silenced list, repair the necessary code until it is fixed, then open a PR. Recently several PRs were introduced that had small warning-fix scope, and hopefully we can get more of those. I still have plans here.
And of course, I will be addressing the other review comments. |
Also, my changes obviate #4989, so when this is done that can be closed. |
Please rebase and resolve current reviews, other warnings can be cleaned up in a follow-up PR |
Squashed & rebased. Clang is clean, but GCC has problems with PCH still. That may be why GCC takes so much longer to build. I tried to look into it, but I get a different error than what is seen on travis. Someone with knowledge of cotire needs to take a look. Also, GCC is giving "notes", which seemingly can't be turned off, as they aren't even warnings. The changes required to fix the note spam is best handled by someone with knowledge of the objects. Anyway, I think this is ready for merge, barring last minute review. The work on MSVC can be done separately. |
Cancelled current build due to big queue, rebase after latest Nekotekina hotfix is merged for a new build, saves compiling time |
Travis seems quiet. Is it ok to push? |
Add default cases. Move default breaks to newline Add proper handling in some instances. Add missing enums to switches
created warnings.
Explicitly mark loop types (per review)
-Indentation warnings -prevent shift overflow -This was declared extern in all contexts. Remove this for initialization -Fix main return types. OH CANADA! -Silence extraneos 'unused expression' warning -Force use return value (warning) -Remove tautological compare copy-pasta (char always < 256)
Some very important things to note:
Any feedback from all contributors is encouraged.